﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrgPersTree_Pers_Edit.aspx.cs" Inherits="SysManage_OrgPersTree_Pers_Edit" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
 <title>人员信息编辑</title>
    <base target ="_self" />
    <link rel="stylesheet" href ="../css/css.css" type="text/css" />
    <!--#include file="../JS/KeyControlCode.js"-->
    <!--#include file="../JS/TrimData.js"--> 
    <!--#include file="../JS/TDTextBoxControl.js"-->
    <script src="../JS/calendar.js" type ="text/javascript"></script>

    <script language ="javascript" type ="text/javascript" >
       //选择组织信息
      var sChoiceID;               //所在赋值的关键字
      var ChoiceNameInfo;          //选择的名称集合
      var ChoiceIDInfo;            //选择的ID集合
      var iChoicePoNumber2 =1;     //0表示任意多,其它的正整数为可以选择的最大个数.不可以为负数
      function GetMyOrgTree(obj)
      {
         var sFeatures = "dialogHeight:600px;dialogWidth:400px;resizeable:no;help:no;status:no";
         var obj = showModalDialog("ChoiceOrgInfo.aspx?ChoiceID="+obj+"&OrgType="+form1.HOrgType.value+"&OrgIDCol=0",window,sFeatures);
         if(obj != undefined)
         {
             sChoiceID = obj.sChoiceID;
             ChoiceNameInfo = obj.ChoiceNameInfo;
             ChoiceIDInfo=obj.ChoiceIDInfo;
             eval("form1.ChoiceName_"+sChoiceID+".value="+ChoiceNameInfo+";");
             eval("form1.HChoiceID_"+sChoiceID+".value="+ChoiceIDInfo+";"); 
             eval("form1.ChoiceName_"+sChoiceID+".blur()");
         }
      }
    </script>
    
</head>
<body>
<% 
  Response .ExpiresAbsolute=System.DateTime.Now. AddSeconds(-1);
  Response.Expires=0;
  Response.CacheControl = "no-cache";
%>
<form id="form1" runat="server">
   <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="15%" valign="top" style="background-image :url(../images/tablelb.gif); height:18px;" class="font13">
      <img height="18" src="../images/tablelbleft.gif" width="18" alt="" /></td>
    <td width="2%" valign="top" style="background-image :url(../images/tablelb.gif); background-color :#ffffff;" class="font13">
      <div align="right"><img height="18" src="../images/tablelbright.gif" width="12" alt="" /></div></td>
    <td colspan="2" valign="middle" bgcolor="#ffffff" class="font13"></td>
  </tr>
  <tr> 
    <td height="26" colspan="2" valign ="middle" style="background-color :#e9ecf5;" class="font13" align ="center" >人员管理</td>
    <td width="80%" height="26" valign="bottom" style="background-image :url(../images/tddi.gif);" class="font13" align ="right"></td>
    <td width="3%" valign="top" style="background-image :url(../images/tddi.gif);" class="font13" align ="right" ><img height="26" src="../images/tddir.gif" alt="" /></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="background-color :#e9ecf5; height :107px;">
  <tr> 
    <td height="147"  valign="top"> 
      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="tablelsdi">
          <tr> 
            <td width="4%" style="background-image :url(../images/tablelb01.gif);"><img src="../images/tablelb01-left.gif" width="21" height="22" /></td>
            <td width="82%" style="background-image :url(../images/tablelb01.gif);" class="font12w">人员信息编辑</td>
            <td width="14%" style="background-image :url(../images/tablelb01.gif);"> <div align="right"><img src="../images/tablelb01-right.gif" width="21" height="22" /></div></td>
          </tr>
        </table>
    <table width="98%" border="1" align="center" cellpadding="0" cellspacing="0" class="tablelb" style ="border-collapse :collapse ;">
      <tr style ="height :26px;">
        <td style="width :20%;" bgcolor="#ECF4FD" class="tableleft" align ="right" >员工号&nbsp;</td>
        <td style="width :30%;" bgcolor="#ECF4FD" class="tableleft"><asp:TextBox ID="PersCode" runat ="server"  onkeydown = "Number(this)" TabIndex ="1" MaxLength ="6"></asp:TextBox><asp:Label ID="Label10" runat ="server" Text ="*" ForeColor="Red"></asp:Label></td>
        <td style="width :20%;" bgcolor="#E1EEFD" class="tableleft" align ="right" >人员名称&nbsp;</td>
        <td style="width :30%;" bgcolor="#E1EEFD" class="tableleft"><asp:TextBox ID="Name" runat ="server" TabIndex ="2" MaxLength ="20"></asp:TextBox><asp:Label ID="tishi1" runat ="server" Text ="*" ForeColor="Red"></asp:Label></td>
      </tr>
      <tr style ="height :26px;">
        <td bgcolor="#ECF4FD" class="tableleft"  align ="right">姓别&nbsp;</td>
        <td bgcolor="#ECF4FD" class="tableleft">
          <asp:dropdownlist id="Sex" tabIndex="3" runat="server" Enabled="true" Width="60px">
			 <asp:ListItem Value="1" Selected ="true" >男</asp:ListItem>
			 <asp:ListItem Value="0">女</asp:ListItem>
		  </asp:dropdownlist></td>
        <td bgcolor="#E1EEFD" class="tableleft" align ="right" >排序号&nbsp;</td>
        <td bgcolor="#E1EEFD" class="tableleft"><asp:TextBox ID="POrder"  onkeydown = "Number(this)" runat ="server" TabIndex ="4" MaxLength ="7"  ></asp:TextBox></td>
      </tr>
      <tr style ="height :26px;">
        <td bgcolor="#ECF4FD" class="tableleft"  align ="right">出生日期&nbsp;</td>
        <td bgcolor="#ECF4FD" class="tableleft"><asp:TextBox ID="Birth"   onclick="calendardate(this,true);"  runat ="server" TabIndex ="5"></asp:TextBox></td>
        <td bgcolor="#E1EEFD" class="tableleft" align ="right" >身份证&nbsp;</td>
        <td bgcolor="#E1EEFD" class="tableleft"><asp:TextBox ID="CardID" onblur="checkidno(this)" runat ="server" MaxLength ="18" TabIndex ="6"  ></asp:TextBox></td>
      </tr>
      <tr style ="height :26px;">
        <td bgcolor="#ECF4FD" class="tableleft"  align ="right"><label id="sjzx" onclick ="GetMyOrgTree(2)">所属组织</label>  &nbsp;</td>
        <td bgcolor="#ECF4FD" class="tableleft">
                     <asp:TextBox ID="ChoiceName_2" runat ="server" onclick ="GetMyOrgTree(2)" TabIndex ="1" Width="120px" ></asp:TextBox>
                     <input type="hidden" id="HChoiceID_2" runat ="server" />
                     <input type="hidden" id="HChoiceID_2_1" runat ="server" />
                </td>
        <td bgcolor="#ECF4FD" class="tableleft"  align ="right">是否负责人&nbsp;</td>
        <td bgcolor="#ECF4FD" class="tableleft">
           <asp:dropdownlist id="OrgPricinal" tabIndex="13" runat="server" Enabled="true" Width="60px">			
			 <asp:ListItem Value="1" >是</asp:ListItem>
			 <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
		  </asp:dropdownlist>
        </td>
      </tr>
      <tr style ="height :26px;">
        <td bgcolor="#E1EEFD" class="tableleft" align ="right" >职务&nbsp;</td>
        <td bgcolor="#E1EEFD" class="tableleft"><asp:DropDownList ID="DutyDL" runat ="server"  ></asp:DropDownList>
        <td bgcolor="#ECF4FD" class="tableleft"  align ="right">固定电话&nbsp;</td>
        <td bgcolor="#ECF4FD" class="tableleft"><asp:TextBox ID="Phone" onblur="checkPhone(this)" runat ="server" TabIndex ="9" MaxLength ="30"></asp:TextBox></td>
      </tr>
      <tr style ="height :26px;">
        <td bgcolor="#E1EEFD" class="tableleft" align ="right" >移动电话&nbsp;</td>
        <td bgcolor="#E1EEFD" class="tableleft"><asp:TextBox ID="Mobile"  onblur="checkPhone(this)" runat ="server" TabIndex ="10" MaxLength ="12"></asp:TextBox></td>
        <td bgcolor="#ECF4FD" class="tableleft"  align ="right">是否有效&nbsp;</td>
        <td bgcolor="#ECF4FD" class="tableleft">
           <asp:dropdownlist id="Effective" tabIndex="11" runat="server" Enabled="true" Width="60px">
			 <asp:ListItem Value="1" Selected ="true" >是</asp:ListItem>
			 <asp:ListItem Value="0">否</asp:ListItem>
		  </asp:dropdownlist>
        </td>
      </tr>
      <tr>
        <td bgcolor="#E1EEFD" class="tableleft" align="right">
          <div id="DivCheckBox" style ="DISPLAY:none"><input type="checkbox" name="Continue" id="IfsavePersHistoryInfo" runat ="server" value="1" onclick ="if(this.checked==true){DivHistoryDesc.style.display='';} else{DivHistoryDesc.style.display='none';}"/></div></td>
         <td bgcolor="#E1EEFD" class="tableleft" colspan ="3"><div id="DivCheckBox2" style ="DISPLAY:none">保存历史信息</div></td>
      </tr>
      </table>
      <div id="DivHistoryDesc" style="DISPLAY:none">
       <table width="98%" border="1" align="center" cellpadding="0" cellspacing="0" class="tablelb" style ="border-collapse :collapse ;">
         <tr>
          <td style ="width:20%;" bgcolor="#E1EEFD" class="tableleft" align="right">变更说明</td>
          <td bgcolor="#E1EEFD" class="tableleft"><asp:TextBox TextMode ="multiline" Rows ="5" Columns ="50" runat ="server" ID ="ChangeReason"></asp:TextBox></td>
         </tr>
      </table>
      </div>
      <table  width="95%" border="0" cellpadding="5" cellspacing="0" align="center" >
      <tr><td style="width: 40%"></td>
        <td>            
            <input id="GrantBtn1" type="submit" runat ="server" class="button02" tabindex ="12"  value ="提交(s)" accesskey ="s" onserverclick="GrantBtn1_ServerClick" /> &nbsp;&nbsp;
            <input type ="button" id="backBtn"  value ="返回(c)" accesskey ="c"  class="button02" tabindex ="13" onclick ="window.close();" /></td>
      </tr>
    </table>
          <input type="hidden" id="hOrgID1" runat ="server"  />
          <input type="hidden" id="hNewOrgID1" runat="server" />
          
          <input type="hidden" id="hOldParentID" runat ="server"  />
          <input type="hidden" id="hNewParentID1" runat ="server"  />
          
          <input type="hidden" id="HPersCode" runat ="server"  />
          
          <input type="hidden" id="hPersID" runat ="server" />
          <input type="hidden" id="hCreator" runat ="server" />
          <input type="hidden" id="hidEditType" runat ="server" />
          <input type="hidden" id="HOrgType" runat ="server"  />
          <input type="hidden" id="HOrgPersID" runat ="server"  />
          
    </form>
    <script  language ="javascript" type="text/javascript">
     <!--
       var iTem;
      var sDeptInfo;
      var iNumber1 = 1;    //0表示任意多,其它的正整数为可以选择的最大个数.不可以为负数
      function ChoiceDept(subtype)
      {
            iTem = subtype;        
            var sFeatures = "dialogHeight:500px;dialogWidth:400px;resizeable:no;help:no;status:no";
            if(iTem == 1)
            {
               var obj = showModalDialog("SelectOtherOrgInfo.aspx?OrgType="+form1.HOrgType.value,window,sFeatures);
               sDeptInfo = obj.sDeptInfo;
               ChangeValue(sDeptInfo,1);
            }
            if(iTem == 2)
            {
               var obj = showModalDialog("SelectOrgInfo.aspx",window,sFeatures);
               sDeptInfo = obj.sDeptInfo;
               ChangeValue(sDeptInfo,2);
            }
       }
        
        function ChangeValue(sDInfo,iNo)
        {
           var cDeptID = "";
           var cDeptName = "";
           var cParentID = "";
           var DeptInfo = sDInfo.split('|');    // ID,Name,ParentID,ChildNumber,PersNumber,DOrder,Effective,PrentName
           nDeptID=DeptInfo.length;
           
           for(j=0;j<nDeptID-1;j++)
           {
             var sStr1=DeptInfo[j];             
             var ary1  = sStr1.split(",");             
             cDeptID += ary1[0]+",";             
             cDeptName += ary1[1]+",";
             cParentID += ary1[2]+",";             
           }
          eval("form1.hNewParentID"+iNo+".value=\""+cDeptID+"\";");          
          eval("form1.OrgName"+iNo+".value=\""+cDeptName+"\";");          
          eval("form1.hNewOrgID"+iNo+".value=\""+cDeptID+"\";");
        }
      -->
    </script>
    
    <script language ="javascript" type="text/javascript" >
    <!--
      var sData = dialogArguments;
      form1.hidEditType.value = sData.stype ;      
      if(sData.stype == "1")  // 2 修改 1 新建
      {
         var sobj = sData.form1.Hcode.value;  //组织信息
         var ary=sobj.split(','); 
         
         form1.ChoiceName_2.value      = trim(ary[1]);
         form1.HChoiceID_2.value       = trim(ary[0]);
         form1.HChoiceID_2_1.value     = trim(ary[0]);
      }
              
      if(sData.stype == "2")  // 2 修改 1 新建
      {
        DivCheckBox.style.display='';
        DivCheckBox2.style.display='';
        var sobj2 = sData.form1.HPCode.value  //人员信息
        var ary2=sobj2.split('|');
        
        form1.HOrgPersID.value    = trim(ary2[0]); 
        
        form1.ChoiceName_2.value      = trim(ary2[14]);
        form1.HChoiceID_2.value       = trim(ary2[13]);
        form1.HChoiceID_2_1.value    = trim(ary2[13]);
        
        form1.hPersID.value = trim(ary2[1]);  //流水号
        form1.PersCode.value = trim(ary2[2]);     //人员名称
        form1.HPersCode.value = trim(ary2[2]);     //人员名称
        form1.Name.value = trim(ary2[3]);     //人员名称
        form1.Sex.value = trim(ary2[4]);      //性别
        form1.Birth.value = trim(ary2[5]);    //出生年月
        form1.CardID.value = trim(ary2[6]);   //身份证
        form1.DutyDL.value = trim(ary2[8]);     //职务
        form1.Phone.value = trim(ary2[9]);    //固定电话
        form1.Mobile.value = trim(ary2[10]);    //手机/小灵通
        form1.POrder.value = trim(ary2[17]);    //排序号
        form1.hCreator.value = trim(ary2[12]);  //创建者
        form1.Effective.value = trim(ary2[18]);  //是否有效
        form1.OrgPricinal.value = trim(ary2[19]);  //负责人
        //form1.DutyDL.value = trim(ary2[13]);     //职务
      }
   -->
  </script>
</body>
</html>

